import { request } from 'umi';

// 获取首页内容
const getHomeDetail = () => {
  return request('/api/home/find', {
    method: 'GET',
  });
};

// 获取文章列表
const getArtList = (data?: any) => {
  return request(
    `/api/article/find?page=${data.page}&pageSize=${data.pageSize}`,
    {
      method: 'GET',
    },
  );
};

// 获取文章详情
const getArtDetail = (data?: any) => {
  return request(`/api/article/detail?id=${data.id}`, {
    method: 'GET',
  });
};
// 提交留言
const passMessage = (data?: any) => {
  return request(`/api/mail/add`, {
    method: 'POST',
    data,
  });
};
export { getHomeDetail, getArtList, getArtDetail, passMessage };
